DumpNetworkSetup dumps the entire contents of the Network Setup database to a text file. The purpose of this sample is twofold. Firstly, it shows a simple use of the Network Setup API. Secondly, it is a useful tool for debugging other Network Setup code because it allows you to see the effect your code had on the database. I used DumpNetworkSetup extensively while developing the MoreNetworkSetup sample.
DumpNetworkSetup requires the Network Setup library, which is available in Mac OS 8.5 and above.
Packing List
The sample contains the following items:
• DumpNetworkSetup.mcp — A project file for the sample.
• DumpNetworkSetup-PPC — A compiled version of the above.
• DumpNetworkSetup.c — Source code to the sample.
• MoreIsBetter — A folder containing the parts of MoreIsBetter that are required by this sample.
Using the Sample
To use the sample, simply double-click it and choose a place to save the report. DumpNetworkSetup will create a text file description of the Network Setup database.
Building the Sample
The sample was built using the CodeWarrior Pro 2 C compiler with Universal Interfaces 3.3.2. You should be able to just open the project, select the “PPC” target, and choose Make from the Project menu. This will build DumpNetworkSetup-PPC.
Caveats
DumpNetworkSetup only compiles for PowerPC because the Network Setup API is only exported to PowerPC clients.
DumpNetworkSetup does not compile for Carbon because the Network Setup API is not supported by Carbon.
DumpNetworkSetup includes formatted output for a number of important network preferences. However, some preferences are still displayed only in hex.
Credits and Version History
If you find any problems with this sample, mail <DTS@apple.com> and I’ll try to fix them up.
1.0b1 (Jul 1999) was the first shipping version.
1.0.1b1 (Sep 1999) is a minor update to add support for printing vector preferences nicely. I also updated the code to compile with the latest Universal Headers version of “NetworkSetup.h”.